Skip to content

chore(ci): keep .git out of the Dagster+ build context - #839

Merged
jirhiker merged 1 commit into
stagingfrom
chore/tighten-docker-context
Aug 19, 2026
Merged

chore(ci): keep .git out of the Dagster+ build context#839
jirhiker merged 1 commit into
stagingfrom
chore/tighten-docker-context

Conversation

@jirhiker

Copy link
Copy Markdown
Member

Every Dagster+ deploy transferred 316 MB of context before the first layer
could build. The tracked tree is 13 MB. The rest was almost entirely .git
CI clones full history, and nothing in the image reads git metadata.

316.65 MB → 6.65 MB.

.dockerignore previously contained one line: .venv.

What else is excluded, and why

Excluded Reason
.git, .github Nothing in the image reads them
__pycache__, *.pyc, *.egg-info Stale bytecode from a different interpreter is worse than useless on a pinned base image
tests/, features/ The image runs the code location; CI runs the suite outside it
transfers/data, logs, metrics Untracked, machine-specific, ~900 MB on a developer checkout — a local docker build was shipping all of it
.terraform/, *.tfstate Provider binaries and state, neither of which belong in an image

Verification

Built the real image with the new context and checked inside it rather than
assuming:

  • db, domain, services, core, schemas, automated_ingestion, and
    alembic are all present
  • from db.transducer import TransducerObservation succeeds
  • domain.units.convert_cm_to_ft(471.518) returns 15.469751
  • the code location resolves all four assets

Not a fix for the open import bug

This is unrelated to ModuleNotFoundError: No module named 'db' in
database_connectivity — that reproduces identically with the old context, and
db/ was always present in the image. #838 carries the diagnostic for it.

🤖 Generated with Claude Code

Every deploy was transferring 316 MB before the first layer could build. The
tracked tree is 13 MB; the rest was almost entirely .git, which CI clones with
full history and which nothing in the image reads. The context is now 6.7 MB.

Also excluded: Python caches, which are worse than useless in an image built on
a pinned base; test fixtures and BDD features, since the image runs the code
location and CI runs the suite outside it; and transfers/data, logs, and
metrics, which are untracked, machine-specific, and roughly 900 MB on a
developer checkout -- a local `docker build` was shipping all of it.

Verified by building the real image with the new context: db, domain, services,
core, schemas, automated_ingestion, and alembic are all present, db and domain
import, and the code location resolves all four assets.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

79.27% total — gate is 75%.

@jirhiker
jirhiker merged commit 63f75f0 into staging Aug 19, 2026
9 checks passed
@jirhiker
jirhiker deleted the chore/tighten-docker-context branch August 19, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant